import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    title: '网页的页签栏标题',
    home: Scaffold(
      // 顶部操作栏
      appBar: AppBar(
        title: Text('标题'),
        backgroundColor: Colors.pink,
      ),
      // 配出正文主题部分
      body: Main(),
    ),
  ));
}

class Main extends StatelessWidget {
  const Main({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.all(5),
        // 1. 使用build构造函数
        child: CustomScrollView(
          slivers: [
            SliverGrid.builder(
               gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: 3,
                mainAxisSpacing: 10,
                crossAxisSpacing: 10
                ),
               itemBuilder: (context, index) {
                 return Container(child: Text('$index') , color: Colors.pink,);
               },
               itemCount: 6,
            
            
            ),
            SliverPadding(padding: EdgeInsets.only(bottom: 10)),
            SliverList.separated(
              itemBuilder: (context, index) {
                 return Container(child: Text('$index') , color: Colors.pink, height: 50,);
              }, 
              separatorBuilder: (BuildContext context, int index) { 
                return Container( color: Colors.grey, height: 1,);
               },
            )
          ],
        ));
  }
}
